package com.shycloud.mido.organ.controller;

import com.shycloud.mido.organ.service.OrganizationService;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.shycloud.mido.common.core.util.R;

import java.util.Map;


/**
 * 移动端机构相关业务 controller
 *
 * @author nianhua.jiang
 * @date 2020/7/9
 */
@RestController
@AllArgsConstructor
@RequestMapping("/moblie/organ/")
@ApiOperation("mobile-机构相关操作")
public class MobileOrganController {

	/** param值：orgId */
	private static final String PARAM_ORG_ID = "orgId";
	/** param值：welcomeWord */
	private static final String PARAM_WELCOME_WORD = "welcomeWord";

	/** 机构模块 service */
	private OrganizationService organizationService;

	/**
	 * 修改机构欢迎语
	 *
	 * @param map
	 * @return com.shycloud.mido.common.core.util.R
	 * @author nianhua.jiang
	 * @date 2020/7/9 15:21
	 */
	@ApiOperation("修改机构欢迎语（标签）")
	@PostMapping("updateWelcomeWord")
	public R updateOrgName(@RequestBody Map<String, Object> map) {

		//机构ID
		Integer orgId = (Integer) map.get(PARAM_ORG_ID);
		//机构欢迎语
		String welcomeWord = (String) map.get(PARAM_WELCOME_WORD);

		return new R(organizationService.updateOrgName(orgId, welcomeWord));
	}

}
